<template>
  <input-round
    placeholder="请输入用户名\工号"
    allow-clear
    @pressEnter="onSearch"
    v-model:value="query.keyWord"
  >
    <template #suffix>
      <span
        style="color: rgba(0, 0, 0, 0.25); cursor: pointer; font-size: 18px"
        @click="onSearch"
      >
        <iconfont name="#icon-sousuo" />
      </span>
    </template>
  </input-round>
</template>
<script setup>
import InputRound from '@/components/input-round.vue'
import iconfont from '@/components/iconfont.vue'
import {
  useQuery,
  useLoading,
  useDataSourceManager,
} from './provide-context.js'

let { update } = useDataSourceManager()

let query = useQuery()
let loading = useLoading()

function onSearch() {
  query.value.current = 1
  if (loading.value) return
  update()
}
</script>
